package io.renren.common.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Component;


/**
 * @author MR.xu email:260139486@qq.com
 * @projectName
 * @Description: 发送QQ邮件
 * @date 2019-09-16
 */
@Component
public class MailSendComponent {

    @Autowired
    JavaMailSender javaMailSender;
    //发送简单邮件
    public void sandSimpleMail(String from,String to,String cc,String subject,String content)
    {
        SimpleMailMessage mailMessage = new SimpleMailMessage();
        mailMessage.setFrom(from);
        mailMessage.setTo(to);
        mailMessage.setCc(cc);
        mailMessage.setSubject(subject);
        mailMessage.setText(content);
        javaMailSender.send(mailMessage);
    }
}
